package ar.edu.utn.frba.tacs.warnes.beans;

import javax.faces.event.ActionEvent;

import ar.edu.utn.frba.tacs.warnes.entities.BaseEntity;
import ar.edu.utn.frba.tacs.warnes.entities.Pedido;
import ar.edu.utn.frba.tacs.warnes.utils.ConstantesWarnes;

/**
 * @author dmiglino
 */
public class PedidoPiezasBrowseBean extends BaseBrowseBean {
	@Override
	protected void cargarDataModel() {
		if (getFromSession(ConstantesWarnes.ENTITY) != null) {
			this.dataModel
					.setWrappedData(((Pedido) getFromSession(ConstantesWarnes.ENTITY))
							.getPiezas());
		}
	}

	public void actionEliminar(ActionEvent e) {
		BaseEntity entity = (BaseEntity) this.dataModel.getRowData();
		doBeforeEliminar(entity);
	}

	@Override
	protected void doBeforeEliminar(BaseEntity entity) {
	}
}
